package com.example.higo.model.impl.homepage;

import com.example.higo.api.service.BaseSubscriber;
import com.example.higo.api.service.RetrofitManager;
import com.example.higo.model.IHomePageModel;
import com.example.higo.model.entity.homepage.HomePageBody;
import com.example.higo.model.entity.homepage.HomePageTab;

import rx.android.schedulers.AndroidSchedulers;
import rx.schedulers.Schedulers;


/**
 * Created by wj on 2016/11/6.
 */

public class HomePageModelImp implements IHomePageModel {

    @Override
    public void getHomePageTabModel(BaseSubscriber<HomePageTab> subscriber) {
        RetrofitManager.getInstance()
                .getHomePageCallBack()
                .getHomePageTabData()
                .observeOn(AndroidSchedulers.mainThread())
                .subscribeOn(Schedulers.io())
                .subscribe(subscriber);
    }

    @Override
    public void getHomePageBodyModel(BaseSubscriber<HomePageBody> subscriber,String page) {
        RetrofitManager.getInstance()
                .getHomePageCallBack()
                .getHomePageBodyData(page)
                .observeOn(AndroidSchedulers.mainThread())
                .subscribeOn(Schedulers.io())
                .subscribe(subscriber);
    }
}
